<template>
  <el-container>
      <div style="width: 180px; text-align: center; font-family: 华文行楷; font-size: 30px; color: #409EFF ">医生后台系统</div>
      <el-dropdown style="width: 100px; cursor: pointer">
        <div style="display: inline-block">
          <img :src="user.photo" alt=""
               style="width: 30px; border-radius: 50%; position: relative; right: 5px">
          <span>{{ user.nickname }}</span><i class="el-icon-arrow-down" style="margin-left: 5px"></i>
        </div>
        <el-dropdown-menu slot="dropdown" style="width: 100px; text-align: center">
          <el-dropdown-item style="font-size: 14px; padding: 5px 0">
            <router-link to="/doctor/phyPerson" style="text-decoration: none">个人信息</router-link>
          </el-dropdown-item>
          <el-dropdown-item style="font-size: 14px; padding: 5px 0">
            <router-link to="/doctor/phyPassword" style="text-decoration: none">修改密码</router-link>
          </el-dropdown-item>
          <el-dropdown-item style="font-size: 14px; padding: 5px 0">
            <span style="text-decoration: none" @click="logout">退出</span>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
<!--      <el-avatar icon="el-icon-user-solid" class="headerLogo"></el-avatar>-->
  </el-container>
</template>

<script>
export default {
  name: "Nav-top",
  props: {
    user: Object
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    logout(){
      localStorage.removeItem("phy")
      this.$message.success("退出成功")
      this.$router.push("/phyLogin")
    }
  },
}
</script>

<style scoped>
section{
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

</style>
